package com.qihetimes.earthangel.common;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.http.HttpStatus;

/**
 * 自定义异常
 *
 * @author ：f4cklangzi@gmail.com
 * @date ：Created At 2021/12/4
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ApiException extends RuntimeException {
    
    private HttpStatus httpStatus = HttpStatus.BAD_REQUEST;
    
    public ApiException(HttpStatus httpStatus, String message) {
        super(message);
        this.httpStatus = httpStatus;
    }
    
    public ApiException(String message) {
        super(message);
    }
    
    public ApiException(Throwable cause) {
        super(cause);
    }
    
    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }
}
